function [ W ] = createWaveletFulltree( n,filterLen,depth )
%this funktion create a sparse filter matrix containing the wavelet
%coefficient
    W = waveN(n,n,filterLen);
    for d = 1:(depth-1)
        N = n/2^d;
        wn = waveN(n,N,filterLen);
        W = wn * W;
    end
       
    
end

function [ wn ] = waveN(n,N,filterLen,depth)
    wn = zeros(N,N);
    w =  dbaux(filterLen);
    [lpd,hpd,lpr,hpr] = orthfilt(w); 
    
    vecLp = zeros(1,N);
    vecHp = zeros(1,N);
    vecLp(1:(filterLen*2)) = lpd;
    vecHp(1:(filterLen*2)) = hpd*(-1) ;
  
    N2 = N/2;
    for k= 1:N2
      wn(k,:) = vecLp;
      wn(k +N2,: ) = vecHp;
      vecLp = circshift(vecLp',2)';
      vecHp = circshift(vecHp',2)';
    end
 
    wn = blkdiag(wn,eye(n-N));
end




